package fastjson;

import com.alibaba.fastjson.JSONObject;
import org.junit.Test;

/**
 * @description: TODO
 * @author: uu
 * @data: 2023/7/9 下午 08:13
 * @version: v1.0
 */
public class test01 {
    @Test
    public void test01() {
        User cms = new User(1, "cms", 20);
        String s = JSONObject.toJSONString(cms);
        System.out.println(s);
        String json = "{\"age\":20,\"id\":1,\"name\":\"cms\"}";
        User user = JSONObject.parseObject(json, User.class);
        System.out.println(user);

    }
}
